package com.onefive.android.utils;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class DateUtil {

	public static final SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
	public static final SimpleDateFormat formatterSimple = new SimpleDateFormat("yyyy/MM/dd");

	public static long parseDateToMillisecinds(String date) {
		long result = 0l;
		try {
			result = formatter.parse(date).getTime();
		} catch (ParseException e) {
			e.printStackTrace();
		}
		return result;
	}

	public static String parseToString(long date) {
		return formatterSimple.format(new Date(date));
	}
}
